home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2002 May / CD Rom Data Mayıs 2002.iso / Freeware / Blitz Basic / data1.cab / Support / help / beginners / tutorial / deepend / 3 - simple file example uncommented.bb < prev    next >
Encoding:
Text File  |  2002-04-10  |  580 b   |  28 lines

  1.  
  2. ; -------------------------------------------------------------
  3. ; Simple file-reading example, with crude string parsing...
  4. ; -------------------------------------------------------------
  5. ; Uncommented version, to show how simple the code really is...
  6.  
  7. Graphics 640, 480
  8.  
  9. Color 150, 150, 200
  10. Print
  11. Print "Reading text from 'test.txt'..."
  12.  
  13. Color 255, 255, 255
  14.  
  15. info = ReadFile ("test.txt")
  16.  
  17. If info
  18.     Repeat
  19.         a$ = ReadLine (info)
  20.         Print a$
  21.     Until Eof (info)
  22.     CloseFile info
  23. Else
  24.     RuntimeError "Failed to read test.txt! Aborting..."
  25. EndIf
  26.  
  27. MouseWait
  28. End